<?php

abstract class JLog
{
    /** @var Zend_Log */
    protected static $log;

    /**
     * @return void
     */
    protected static function initialize()
    {
        if (!isset(self::$log)) {
            $writer = new Zend_Log_Writer_Stream('log');
            self::$log = new Zend_Log($writer);
        }
    }

    /**
     * @param string $message
     * @param int $priority
     * @param mixed $extras
     * @bool return bool
     */
    public static function log($message, $priority = Zend_Log::DEBUG, $extras = null)
    {
        self::initialize();
        self::$log->log($message, $priority, $extras);
    }
}